package weightChange;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

public class demo {
	public static void main(String age[]) {
		int[] arr={95,45,15,78,84,51,24,12};
//		bubble_show(arr);
		bubble_sort(arr);
//		bubble_show(arr);
		
	}

	public static void bubble_sort(int[] arr) {
		int temp = 0, len = arr.length;
		for (int i = 0; i < len - 1; i++) {
			for (int j = 0; j < len - 1 - i; j++) {
				if (arr[j] > arr[j + 1]) {
					temp = arr[j];
					arr[j] = arr[j + 1];
					arr[j + 1] = temp;
				}
			}

		}
	}
	
	public static void bubble_show(int[]arr){
		int a=0;
		for (int i : arr) {
			System.out.print(i+"\t");
			a++;
			if(a==4)
				System.out.println();
		}
		System.out.println();
		System.out.println("---------------------------------");
	}
}
